package com.wxb.cardmis.controller;

import com.wxb.cardmis.entity.CardEntity;
import com.wxb.cardmis.service.CardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;

/**
 * All rights Reserved, Designed By www.super-master.cn
 *
 * @ProjectName: cardmis
 * @Package: com.wxb.cardmis.controller
 * @ClassName: CardController
 * <p> </p>
 * @Author: [Wei Xiao]
 * @Date: 2022/2/21 23:08
 * @Version: V1.0
 * @Copyright: 2022  com.wei All rights reserved.
 * TODO: 注意,本文件Wei Xiao所作,如果转载或使用请标明具体出处!
 * @Date: 2022年02月21日 23:08
 * @Description: []
 **/
@RestController

public class CardController {
    @Autowired
    private CardService cardService;
    @CrossOrigin
    @PostMapping("cardmis/add")
    public String add(CardEntity cardEntity, HttpSession session, MultipartFile file){
        return cardService.add(cardEntity,session,file);
    }

    @CrossOrigin
    @GetMapping("cardmis/cards")
    public  Object cards(HttpSession session){
        return cardService.cards(session);
    }
    @CrossOrigin
    @PostMapping("cardmis/delete")
    public String delete(HttpSession session,Integer cid){
        return cardService.delete(session,cid);
    }

    @CrossOrigin
    @GetMapping("cardmis/aCard")
    public Object aCard(HttpSession session,Integer cid){
        return cardService.aCard(session,cid);
    }

}
